﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using Visifire.Gauges;

namespace CPPEI.Coolzon.UI.DataPartLib
{
    public partial class DataGaugeBase
    {
        public ScaleLabels GetScaleLabels()
        {
            ScaleLabels scaleLabels = new ScaleLabels();
            scaleLabels.Visibility = IsCircularScaleLabelsEnabled ? Visibility.Visible : Visibility.Collapsed;
            scaleLabels.FontColor = CircularScaleLabelsFontColor==null? null : CircularScaleLabelsFontColor.Brush;
            scaleLabels.FontFamily = CircularScaleLabelsFontFamily;
            scaleLabels.FontSize = CircularScaleLabelsFontSize;
            scaleLabels.FontWeight = CircularScaleLabelsFontWeight;

            scaleLabels.Placement = CircularScaleLabelsPlacement;
            scaleLabels.RotationEnabled = CircularScaleLabelsRotationEnabled;

            return scaleLabels;
        }


        private BrushEx circularScaleLabelsFontColor;
        private FontFamily circularScaleLabelsFontFamily;
        private int circularScaleLabelsFontSize;
        private FontWeight circularScaleLabelsFontWeight;
        private double circularScaleLabelsInterval;
        private PlacementTypes circularScaleLabelsPlacement;
        private bool circularScaleLabelsRotationEnabled;

        [Category("标尺文本")]
        [DisplayName("标尺文本字体颜色")]
        [Description("CircularScaleLabelsFontColor")]
        [Editor(typeof(UI.XProperty.Editors.XBrushEditor), typeof(UI.XProperty.XPropertyValueEditor))]
        [XProperty(XPropertyCategory.Other, "CircularScaleLabelsFontColor", "标尺文本字体颜色")]
        public BrushEx CircularScaleLabelsFontColor
        {
            get
            {
                return circularScaleLabelsFontColor;
            }

            set
            {
                circularScaleLabelsFontColor = value;
                Refresh();
            }
        }

        [Category("标尺文本")]
        [DisplayName("标尺文本字体")]
        [Description("CircularScaleLabelsFontFamily")]
        [Editor(typeof(UI.XProperty.Editors.XFontFamilyEditor), typeof(UI.XProperty.XPropertyValueEditor))]
        [XProperty(XPropertyCategory.Other, "CircularScaleLabelsFontFamily", "标尺文本字体")]
        public FontFamily CircularScaleLabelsFontFamily
        {
            get
            {
                return circularScaleLabelsFontFamily;
            }

            set
            {
                circularScaleLabelsFontFamily = value;
                Refresh();
            }
        }

        [Category("标尺文本")]
        [DisplayName("标尺文本字体大小")]
        [Description("CircularScaleLabelsFontSize")]
        [Editor(typeof(UI.XProperty.Editors.XIntEditor), typeof(UI.XProperty.XPropertyValueEditor))]
        [XProperty(XPropertyCategory.Other, "CircularScaleLabelsFontSize", "标尺文本字体大小")]
        public int CircularScaleLabelsFontSize
        {
            get
            {
                return circularScaleLabelsFontSize;
            }

            set
            {
                circularScaleLabelsFontSize = value;
                Refresh();
            }
        }

        [Category("标尺文本")]
        [DisplayName("标尺文本字体粗细")]
        [Description("CircularScaleLabelsFontWeight")]
        [Editor(typeof(UI.XProperty.Editors.XFontFamilyEditor), typeof(UI.XProperty.XPropertyValueEditor))]
        [XProperty(XPropertyCategory.Other, "CircularScaleLabelsFontWeight", "标尺文本字体粗细")]
        public FontWeight CircularScaleLabelsFontWeight
        {
            get
            {
                return circularScaleLabelsFontWeight;
            }

            set
            {
                circularScaleLabelsFontWeight = value;
                Refresh();
            }
        }

        //[Category("标尺文本")]
        //[DisplayName("标尺文本步长")]
        //[Description("CircularScaleLabelsInterval")]
        //[Editor(typeof(UI.XProperty.Editors.XDoubleEditor), typeof(UI.XProperty.XPropertyValueEditor))]
        //[XProperty(XPropertyCategory.Other, "CircularScaleLabelsInterval", "标尺文本步长")]
        public double CircularScaleLabelsInterval
        {
            get
            {
                return circularScaleLabelsInterval;
            }

            set
            {
                circularScaleLabelsInterval = value;
                Refresh();
            }
        }

        [Category("标尺文本")]
        [DisplayName("标尺文本位置")]
        [Description("CircularScaleLabelsPlacement")]
        [Editor(typeof(UI.DataPartLib.XProperty.Editors.XPlacementTypesEditor), typeof(UI.XProperty.XPropertyValueEditor))]
        [XProperty(XPropertyCategory.Other, "CircularScaleLabelsPlacement", "标尺文本位置")]
        public PlacementTypes CircularScaleLabelsPlacement
        {
            get
            {
                return circularScaleLabelsPlacement;
            }

            set
            {
                circularScaleLabelsPlacement = value;
                Refresh();
            }
        }

        [Category("标尺文本")]
        [DisplayName("标尺文本是否旋转")]
        [Description("CircularScaleLabelsRotationEnabled")]
        [Editor(typeof(UI.XProperty.Editors.XBooleanEditor), typeof(UI.XProperty.XPropertyValueEditor))]
        [XProperty(XPropertyCategory.Other, "CircularScaleLabelsRotationEnabled", "标尺文本是否旋转")]
        public bool CircularScaleLabelsRotationEnabled
        {
            get
            {
                return circularScaleLabelsRotationEnabled;
            }

            set
            {
                circularScaleLabelsRotationEnabled = value;
                Refresh();
            }
        }
        [Category("标尺文本")]
        [DisplayName("标尺文本是否显示")]
        [Description("IsCircularScaleLabelsEnabled")]
        [Editor(typeof(UI.XProperty.Editors.XBooleanEditor), typeof(UI.XProperty.XPropertyValueEditor))]
        [XProperty(XPropertyCategory.Other, "IsCircularScaleLabelsEnabled", "标尺文本是否显示")]
        public bool IsCircularScaleLabelsEnabled
        {
            get
            {
                return isCircularScaleLabelsEnabled;
            }

            set
            {
                isCircularScaleLabelsEnabled = value;
                Refresh();
            }
        }

        private bool isCircularScaleLabelsEnabled;
    }
}
